# 1!+2!+3！+4!+...+n!
'''
1！=1
2！=2
3！=6
4！=24
'''

# for循环
n = 4
result1 = 0
tmp = 1
for i in range(1,n+1):
    tmp *= i
    result1 += tmp

# while循环
i = 1
tmp = 1
result2 =0
while i<=n:
    tmp *= i
    result2 += tmp
    i +=1

print(result2)
